﻿//双击事件
function CustomDbClick() {
    parent.closeWin(); //去掉双击功能
}

//查看明细
var fnLinkSolutionItem = function (elCell, oRecord, oColumn, sData) {
    //debugger;
    elCell.innerHTML = "<a href=\"#\" onclick=\"javascript:fnSolutionItem('" + oRecord.getData("SolutionID") + "','" + sData + "');\">" + sData + "</a>";
};

//打开链接
var fnSolutionItem = function (solutionID, solutionName) {
    var pagetitle = "查看考核方案【" + solutionName + "】";
    parent._employeeTitle = pagetitle;
    parent.addTabs(pagetitle, encodeURI("../Extend/Edit.aspx?r=" + Math.random() + "&entity=ExaminationSolution&fun=view" + "&id=" + solutionID));
    parent.NeedRefreshPage = this;
}

//考核
var fnExamine = function () {
    var recordID = myDataTable.getSelectedRows()[0];
    record = myDataTable.getRecord(recordID);
    if (record == null) {
        alert("请选择一条记录");
        return;
    }
    var roleID = record.getData(const_entityID);
    var solutionID = record._oData["SolutionID"];
    var objectID = record._oData["ObjectID"];
    var planID = record._oData["PlanID"];
    var isAppraise = record._oData["IsAppraise"];
    var url = "../EHR/hrExamineSorce.aspx?solutionID=" + solutionID + "&objectID=" + objectID + "&roleID=" + roleID + "&planID=" + planID;
    var pagetitle = "考核打分";
    if (isAppraise == "Y") {
        if (confirm("此任务已考核打分，确定要修改吗?")) {
            //document.getElementById("EditUIWindow").src = "../EHR/hrExamineSorce.aspx?solutionID=" + solutionID + "&objectID=" + objectID + "&roleID=" + roleID + "&planID=" + planID;
            //SetDWH(900, 600, YAHOO.example.container.dialog1);
            //YAHOO.example.container.dialog1.show();
            parent._employeeTitle = pagetitle;
            parent.addTabs(pagetitle, encodeURI(url));
            parent.NeedRefreshPage = this;
        }
    }
    else {
        //        document.getElementById("EditUIWindow").src = "../EHR/hrExamineSorce.aspx?solutionID=" + solutionID + "&objectID=" + objectID + "&roleID=" + roleID + "&planID=" + planID;
        //        SetDWH(900, 600, YAHOO.example.container.dialog1);
        //        YAHOO.example.container.dialog1.show();
        parent._employeeTitle = pagetitle;
        parent.addTabs(pagetitle, encodeURI(url));
        parent.NeedRefreshPage = this;
    }
}

